package com.jxb.visibility.threadpool;

import java.util.concurrent.*;
//import lombok.extern.slf4j.Slf4j;
//
//@Slf4j
public class TPETest {

    public static void main(String[] args) {
        ThreadFactory threadFactory = new ThreadFactory() {
            @Override
            public Thread newThread(Runnable r) {
                return new Thread(r,"test业务");
            }
        };

        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 1, 3000, TimeUnit.MILLISECONDS,
                new ArrayBlockingQueue<>(1),threadFactory,new RefejectDemo());
        for (int i = 0; i< 100 ;i++) {
            threadPoolExecutor.execute(new Thread(new Runnable() {
                @Override
                public void run() {
                    System.out.println(123);
                }
            }));
        }
    }

}
